﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Mail.Master" %>
<%@ Import Namespace="Animaonline.Weather.WeatherData" %>

<asp:Content runat="server" ID="cTitle" ContentPlaceHolderID="cphTitle">
    <% this.Page.Title = (string)ViewData["PageTitle"]; %>
</asp:Content>

<asp:Content runat="server" ID="cHeaderTitle" ContentPlaceHolderID="cphHeaderTitle">
    <img src="/Design/Images/MailImages/meetings.jpg" alt="" />
</asp:Content>

<asp:Content runat="server" ID="cHeaderLogo" ContentPlaceHolderID="cphHeaderLogo">
    <a href="/?utm_source=mail&amp;utm_medium=Logo&amp;utm_campaign=<%= ViewData["CampaignName"] %>" target="_blank">
        <img src="/Design/Images/MailImages/mailLogo.jpg" border="0" alt="<%= ViewData["SiteName"] %>" width="151" height="132" />
    </a>
</asp:Content>

<asp:Content runat="server" ID="cMainContent" ContentPlaceHolderID="cphMainContent">
    <p style="font-size:11px; color:#ffffff; font-family:Verdana, Arial, Helvetica, sans-serif">Bonjour <%= ViewData["UserLogin"].ToString().UppercaseFirst() %> ,<br />
    Comme chaque semaine, voici les évènements à venir de ton Unité favorite. Si tu désires plus d’informations, tu peux consulter <a href="/" style="color:#fff">le site de l’Unité</a>.</p>
    
    <h1 style="font-size:16px; color:#ffffff; font-family:Verdana, Arial, Helvetica, sans-serif">Le(s) rendez-vous de ce week-end</h1>
	
    <% if (ViewData["Events"] != null && ((List<sp_Site_GetNextMeetingsResult>)ViewData["Events"]).Count > 0){ %>
        <% foreach (sp_Site_GetNextMeetingsResult sectionEvent in (List<sp_Site_GetNextMeetingsResult>)ViewData["Events"]){ %>
		     <div style="margin-bottom:15px; color:#ffffff; font-family:Verdana, Arial, Helvetica, sans-serif">
                <h2 style="padding:0px 0px 0px 0px; margin:2px 0px 2px 0px; font-size:13px; color:#ffffff;"><%= sectionEvent.Section %></h2>
                <div style="padding-left:10px">
                    <%
                        string schedule = string.Empty;
                        if ((EventType)sectionEvent.EventType != EventType.Respite)
                        {
                            if (sectionEvent.EStartDate.ToString("dd/MM/yy") != sectionEvent.EEndDate.ToString("dd/MM/yy"))
                            {
                                schedule = "Du " + sectionEvent.EStartDate.ToString("dd/MM/yy HH:mm") + " au " + sectionEvent.EEndDate.ToString("dd/MM/yy HH:mm");
                            }
                            else
                            {
                                schedule = "De " + sectionEvent.EStartDate.ToString("HH:mm") + " à " + sectionEvent.EEndDate.ToString("HH:mm");
                            }  
                        }             
                    %>
                    <p style="font-size:11px; color:#ffffff;">
                        <img src="/Design/Images/MailImages/calendar.png" style="vertical-align:middle" alt="" />
                        <strong style="font-size:12px"><%= sectionEvent.Title%></strong>
                        <% if (!string.IsNullOrEmpty(schedule)){ %>
                             - <%= schedule%><br />
                        <% } %>
                        <% if ((EventType)sectionEvent.EventType != EventType.Respite){ %>
                        <img src="/Design/Images/MailImages/house.png" style="vertical-align:middle" alt="" /> <%= sectionEvent.Location %>
                        <% } %>                    
                    </p>

                    <% 
                        tSite_Staff staffModrator = ((List<tSite_Staff>)ViewData["Staff"]).Where(p => p.SID == sectionEvent.SID).Take(1).SingleOrDefault();
                        if (staffModrator != null && (!string.IsNullOrEmpty(staffModrator.Mobile) || !string.IsNullOrEmpty(staffModrator.Phone))){
                    %>
                        <p style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px; font-size:11px; color:#ffffff;">
                            Si tu ne sais pas être présent <strong>contacte <%= staffModrator.Firstname %> <%= staffModrator.Lastname %></strong> au <strong><%= (!string.IsNullOrEmpty(staffModrator.Mobile)) ? staffModrator.Mobile : staffModrator.Phone %></strong> ou un <%= Html.ActionLink("autre membre du staff " + sectionEvent.Section.ToLower(), "Index", new { controller = "Staff", systemName = sectionEvent.SystemName.UppercaseFirst() }, new { style = "color:#ffffff" })%>
                        </p>
                    <% } %>

                    <% if (sectionEvent.CID != null){ %>
                        <p style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px; font-size:11px; color:#ffffff;">
                            Plus d'informations dans la convocation du <%= Html.ActionLink(sectionEvent.CStartDate.Value.ToString("dd/MM/yyyy") + " au " + sectionEvent.CEndDate.Value.ToString("dd/MM/yyyy"), "Detail", new { systemName = sectionEvent.SystemName.UppercaseFirst(), controller = "Convoc", id = sectionEvent.CID }, new { style = "color:#ffffff" })%>
                        </p>
                    <% } %>
                </div>
             </div>
	    <% } %>
    <% }else{ %>
	     <div style="margin-bottom:15px; color:#ffffff; font-size:12px; font-family:Verdana, Arial, Helvetica, sans-serif">
            Il n'y a pas de rendez-vous ce week-end
         </div>
    <% } %>

    <% if (ViewData["NextEvents"] != null && ((List<sp_Site_GetNextMeetingsResult>)ViewData["NextEvents"]).Count > 0){ %>
        <h1 style="font-size:16px; color:#ffffff; font-family:Verdana, Arial, Helvetica, sans-serif">Le(s) prochain(s) rendez-vous</h1>
	    <% foreach (sp_Site_GetNextMeetingsResult sectionEvent in (List<sp_Site_GetNextMeetingsResult>)ViewData["NextEvents"]) { %>
		     <%
                string schedule = string.Empty;
                if ((EventType)sectionEvent.EventType != EventType.Respite)
                {
                    if (sectionEvent.EStartDate.ToString("dd/MM/yy") != sectionEvent.EEndDate.ToString("dd/MM/yy"))
                    {
                        schedule = "Du " + sectionEvent.EStartDate.ToString("dd/MM/yy HH:mm") + " au " + sectionEvent.EEndDate.ToString("dd/MM/yy HH:mm");
                    }
                    else
                    {
                        schedule = "De " + sectionEvent.EStartDate.ToString("HH:mm") + " à " + sectionEvent.EEndDate.ToString("HH:mm");
                    }
                }       
            %>
             <div style="margin-bottom:15px; color:#ffffff; font-family:Verdana, Arial, Helvetica, sans-serif">
                <h2 style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px; font-size:13px; color:#ffffff;"><%= sectionEvent.Section %></h2>
                <div style="padding-left:10px">
                    <p style="font-size:11px; color:#ffffff;">
                        <img src="/Design/Images/MailImages/calendar.png" style="vertical-align:middle" alt="" />
                        <strong style="font-size:12px"><%= sectionEvent.Title%></strong>
                        <% if (!string.IsNullOrEmpty(schedule)){ %>
                         - <%= schedule %><br />
                        <% } %>
                        <% if ((EventType)sectionEvent.EventType != EventType.Respite){ %>
                        <img src="/Design/Images/MailImages/house.png" style="vertical-align:middle" alt="" /> <%= sectionEvent.Location%>                        
                        <% } %>
                    </p>
                </div>
             </div>
	    <% } %>
    <% } %>

    <p style="font-size:11px; color:#FF0000; font-family:Verdana, Arial, Helvetica, sans-serif">Sous réserve de corrections apportées par le(s) staff(s)</p>
    <% if (ViewData["Conditions"] != null){ %>
    <h1 style="font-size:16px; color:#ffffff; font-family:Verdana, Arial, Helvetica, sans-serif">Comment s'habille-t-on ce week-end?</h1>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
        <% foreach (ForecastCondition item in (List<ForecastCondition>)ViewData["Conditions"]){ %>
		    <td style="padding-right:10px"><img src="http://www.google.be<%= item.Icon %>" style="vertical-align:middle; border:1px solid #fff;" alt="" /></td>
            <td><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" style="font-size:10px"><%= item.Day%> <%= item.Low.Celsius%> ° à  <%= item.High.Celsius%>°<br /> <%= item.Condition%></font></td>
	    <% } %>
        </tr>
    </table>
    <% } %>                  
    <p><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif" style="font-size:11px">Nos amiti&eacute;s scoutes, le staff d'unité.</font></p>
</asp:Content>

<asp:Content runat="server" ID="cImageStat" ContentPlaceHolderID="cphImageStat">
    <img src="/Global/MailsStats/<%= ViewData["MailID"] %>/<%= ViewData["UserID"] %>.gif" height="1" width="1" alt="" />
</asp:Content>

<asp:Content runat="server" ID="cFooter" ContentPlaceHolderID="cphFooter">
    <font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" style="font-size:10px">
        <a href="/?utm_source=mail&amp;utm_medium=Footer%20Link&amp;utm_campaign=<%= ViewData["CampaignName"] %>" style="color:#000000; text-decoration:none">&copy; <%= ViewData["SiteName"]%> <%= ViewData["CopyrightDate"] %></a>
    </font>
</asp:Content>                                